<template>
<div>
<h1>主页</h1>
  <table>
    <tr>
      <td>商品</td>
      <td>类型</td>
    </tr>
    <tr v-for="i in list">
      <td>{{i.name}}</td>
      <td>{{i.fenlei}}</td>
    </tr>
  </table>
  <button v-for="i in num" @click="get(i)">{{i}}</button>


</div>
</template>

<script>
export default {
  name: "dj_django",
  data(){
    return{
      list:[],
      num:''
    }
  },
  methods:{
    get(i){
      this.$axios.get('users/User_API/?cpage='+i)
      .then(i=>{
        this.num = i.data.num
        this.list = i.data.list
      })
    }
  },
  mounted() {
    this.get(1)
  }
}
</script>

<style scoped>

</style>
